﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="DesvioList.aspx.cs"
    Inherits="WebAppPlanProduccion.App.DesvioList" %>

<asp:Content ID="HeaderContent" ContentPlaceHolderID="HeadContent" runat="server">   
    <link href="/Styles/PlanProdCtrl.css" rel="stylesheet" type="text/css" />
    <link href="/Styles/Desvios.css" rel="stylesheet" type="text/css" />    
    <script type="text/javascript">
        $(function () {
            $('#txtFechaDesde').datepick({ dateFormat: 'dd/mm/yyyy' });
            $('#txtFechaHasta').datepick({ dateFormat: 'dd/mm/yyyy' });
            $('#txtFechaDesvioDesde').datepick({ dateFormat: 'dd/mm/yyyy' });
            $('#txtFechaDesvioHasta').datepick({ dateFormat: 'dd/mm/yyyy' });
        });
    </script>
</asp:Content>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
    <asp:Image Width="15px" Height="15px" ID="imgExpandResults" CssClass="imgExpand"
            ImageUrl="/Images/icon_blockexpanded.png" runat="server" ClientIDMode="Static"
            alt="" onclick="window.AppCommonObj.toggleVisibility(this.id, 'searchBox');" />
        Buscar Desv&iacute;os
    </h2>
    <div class="editionContainerFilter" id="searchBox">
        <p>
            <span class="title">Id de Desv&iacute;o:</span>
            <asp:TextBox ID="txtDesvioId" runat="server" CssClass="inputs" ClientIDMode="Static" CampoFiltro="True"></asp:TextBox>
        </p>
        <p>
            <span class="title secondColumn">Id de Plan:</span>
            <asp:TextBox ID="txtPlanProduccionId" runat="server" CssClass="inputs" ClientIDMode="Static" CampoFiltro="True"></asp:TextBox>
        </p>
          <div class="clear">
        </div>
         <p>
            <span class="title">Temporada:</span>
            <asp:DropDownList ID="cboTemporada" runat="server" CssClass="cbo" CampoFiltro="True">
            </asp:DropDownList>
        </p>
        <p>
            <span class="title secondColumn">Proveedor:</span>
            <asp:DropDownList ID="cboProveedor" runat="server" CssClass="cbo inputlong" CampoFiltro="True">
            </asp:DropDownList>
        </p>
         <div class="clear">
        </div>
         <p>
            <span class="title ">Producto:</span>
            <asp:TextBox ID="txtProducto" runat="server" CssClass="inputs" ClientIDMode="Static" CampoFiltro="True"></asp:TextBox>
        </p>
         <p>
            <span class="title secondColumn">Destino:</span>
            <asp:DropDownList ID="cboDestino" runat="server" CssClass="cbo" CampoFiltro="True">
            </asp:DropDownList>
        </p>
        <div class="clear">
        </div>       
          <p>
            <span class="title">Color:</span>
            <asp:TextBox ID="txtColor" runat="server" CssClass="inputs" ClientIDMode="Static" CampoFiltro="True"></asp:TextBox>
        </p>
        <p>
            <span class="title secondColumn">Causa:</span>
            <asp:DropDownList ID="cboDesvioCausa" runat="server" CssClass="cbo inputlong" CampoFiltro="True">
            </asp:DropDownList>
        </p>
         <div class="clear">
        </div>
        <p>
            <span class="title">Tipo de Desv&iacute;o:</span>
            <asp:DropDownList ID="cboTipoDesvio" runat="server" CssClass="cbo" CampoFiltro="True">
            </asp:DropDownList>
        </p>
        <p>
            <span class="title secondColumn">Estado:</span>
            <asp:DropDownList ID="cboEstado" runat="server" CssClass="cbo" CampoFiltro="True">
            </asp:DropDownList>
        </p>        
        <div class="clear">
        </div>
         <div class="clear">
        </div>
          <p>
            <span class="title">Fecha Creación Desde:</span>
            <asp:TextBox ID="txtFechaDesde" ClientIDMode="Static" runat="server" CssClass="inputs" CampoFiltro="True"></asp:TextBox>
        </p>     
         <p>
            <span class="title secondColumn">Fecha Creación Hasta:</span>
            <asp:TextBox ID="txtFechaHasta" ClientIDMode="Static" runat="server" CssClass="inputs" CampoFiltro="True"></asp:TextBox>
        </p>              
        <div class="clear">
        </div>
         <p>
            <span class="title">Fecha Desvío Desde:</span>
            <asp:TextBox ID="txtFechaDesvioDesde" ClientIDMode="Static" runat="server" CssClass="inputs" CampoFiltro="True"></asp:TextBox>
        </p>        
        <p>
            <span class="title secondColumn">Fecha Desvio Hasta:</span>
            <asp:TextBox ID="txtFechaDesvioHasta" ClientIDMode="Static" runat="server" CssClass="inputs" CampoFiltro="True"></asp:TextBox>
        </p>               
        <div class="clear">
        </div>
        <p>
            <asp:LinkButton ID="lnkBuscar" runat="server" OnClick="lnkBuscar_Click">Buscar</asp:LinkButton>
            <a href="#" onclick="return window.AppCommonObj.clearFilters('pnlResults');">Limpiar</a>
        </p>
        <div class="clear">
        </div>
    </div>
    <h2>
        Listado de Desv&iacute;os
    </h2>
    <asp:Panel ID="pnlResults" CssClass="editionContainerForGrid" runat="server" ClientIDMode="Static">
        <asp:GridView ID="GridDesvios" runat="server" CellPadding="4" ForeColor="#333333"
            GridLines="None" AutoGenerateColumns="False" DataKeyNames="Id" Width="100%" AllowPaging="True"
            OnPageIndexChanging="GridDesvios_PageIndexChanging" OnRowCommand="GridDesvios_RowCommand"
            OnRowDataBound="GridDesvios_RowDataBound">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <%--<asp:ButtonField ButtonType="Image" CommandName="aprobar" ImageUrl="~/Images/aprobar.png"
                    Text="Button" AccessibleHeaderText="aprobar">
                    <HeaderStyle HorizontalAlign="Left" Width="30px" />
                    <ItemStyle HorizontalAlign="Center" />
                </asp:ButtonField>--%>
                <asp:ButtonField ButtonType="Image" CommandName="editar" ImageUrl="~/Images/editar.png"
                    Text="Button" AccessibleHeaderText="editar">
                    <HeaderStyle HorizontalAlign="Left" Width="30px" />
                    <ItemStyle HorizontalAlign="Center" />
                </asp:ButtonField>
               <asp:TemplateField HeaderText="">
                    <HeaderStyle HorizontalAlign="Left" Width="30px" />
                    <ItemStyle HorizontalAlign="Center" />
                    <ItemTemplate>
                        <asp:ImageButton ID="btnEliminar" 
                            runat="server" ImageUrl="~/Images/eliminar.png" CommandName="eliminar" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" />
                    </ItemTemplate>
                </asp:TemplateField>    
                 <asp:ButtonField ButtonType="Image" CommandName="ver" ImageUrl="~/Images/ver.png"
                    Text="Button" AccessibleHeaderText="editar">
                    <HeaderStyle HorizontalAlign="Left" Width="30px" />
                    <ItemStyle HorizontalAlign="Center" />
                </asp:ButtonField>
                <asp:BoundField DataField="Id" HeaderText="Id">
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="PlanProduccionId" HeaderText="Id de Plan">
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="TipoDesvioNombre" HeaderText="Tipo">
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                 <asp:BoundField DataField="ProductoSapArticuloNombre" HeaderText="Producto">
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="ProductoIdExterno" HeaderText="Código">
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="ProductoSapColorNombre" HeaderText="Color">
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="EstadoAprobacion" HeaderText="Estado">
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="DesvioCambiosCantidades" HeaderText="Cantidades Modificadas">
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="FechaCreacion" HeaderText="Fecha Creación">
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                 <asp:BoundField DataField="FechaDesvio" HeaderText="Fecha De Desvío">
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#4b6c9e" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
            <PagerStyle BackColor="#4b6c9e" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
    </asp:Panel>

    <script type='text/javascript'>

        $(document).ready(function () {

            if (!window.AppCommonObj) {
                window.AppCommonObj = new AppCommon();
            }                        
        });
    </script>

</asp:Content>
